<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .box {
            width: 100px;
            height: 100px;
            border: 1px solid #000;
        }

        body {
            height: 5000px;
        }

        img {
            width: 100px;
            position: absolute;
        }
    </style>
    <script src="../08dom/js/jquery1.11.3.js"></script>
</head>

<body>
    <button></button>
    <div class="box"></div>
    <button>嗲你</button>
    <!-- <img src="./1.jpeg" alt=""> -->
    <img src="./1.jpeg" alt="">
    <script>
        // let img = document.getElementsByTagName('img')[0]
        // let box = document.getElementsByTagName('div')[0]
        // document.onclick = function (e) {
        //     e = e || event
        //     console.log(e.pageX, e.pageY)

        //     console.log(e.clientX, e.clientY)
        //     // 浏览器显示屏左上角
        //     console.log(e.screenX)
        // }
        // document.onmousemove = function (e) {

        //     $('img').css({ left: x - $('img').width() / 2, top: y - $('img').height() / 2 })
        // }
        // $('button').click(() => {
        //     $('img').width((index, oldval) => oldval * 2)
        // })
        let time = null
        $('img').mouseover(() => {
            time = setInterval(() => {
                $('img').width((index, oldval) => oldval * 1.1)
            }, 500);
        })
        clearInterval(time)
        $('img').mouseout(() => {
            setInterval(() => {
                $('img').width((index, oldval) => oldval * 0.9)
            }, 500)
        })
        // $('img').mouseover($('img').width((index, oldval) => oldval * 2))
    </script>
</body>

</html>